Technote TB 26 | August 1989 |
Changes since August 1989: Corrected references to SetItemCmd from SetItmCmd.
Since the release of MultiFinder, you may have noticed the appearance of small icons ('SICN') in the menus of some System Software. At that time, the Menu Manager was modified to allow the capability of showing both 'SICN' resources and 'ICON' resources reduced to 'SICN' size.
To add one of the smaller icons to a menu item with Rez or ResEdit, do the following:
Reduced Icon
* Place a value of $1D into the cmdChr field of the menuItem.
* Place the resource ID number of the 'ICON' to use, minus 256, into the itemIcon field of the menuItem.
Small Icon
* Place a value of $1E into the cmdChr field of the menuItem.
* Place the resource ID number of the 'SICN' to use, minus 256, into the itemIcon field of the menuItem.
In the ResEdit 'MENU' template, the cmdChr field is called "Key equiv" and the itemIcon field is called "Icon#."
For setting or changing the menu from within your program, use the following:
SetItemCmd(theMenu,item,$1D) { mark menu item as having a reduced icon} SetItemIcon(theMenu,item,icon)
or
SetItemCmd(theMenu,item,$1E) { mark menu item as having a SICN } SetItemIcon(theMenu,item,icon)
Note that the resource ID that you indicate to the Menu Manager is 256 less than the icon's real resource ID. This means that you can only use icons starting with resource ID of 257 (remember that a zero indicates no icon). Figure 1 illustrates a menu with 'SICN' resources in the first three items, a normal 'ICON' in the fourth item, and a reduced version of the normal 'ICON' in the fifth item.
Figure 1-Menu Containing a 'SICN', an 'ICON', and a Reduced 'ICON'
Note that this new facility does not come for free. A menu item that contains a 'SICN' or a reduced icon cannot also have a command key equivalent. Because the addition of a smaller icon must be somehow recorded into the existing menu record, the cmdChr field of your menu item that used to contain the command key equivalent is now used to indicate both the command key to use or the use of a smaller icon.
Further Reference:
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help